#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
#include<assert.h>
#include<stdlib.h>
#include<string.h>
#include<time.h>

typedef int hpDataType;

typedef struct heap
{
	hpDataType* a;
	int size;
	int capacity;
}HP;


void HeapInit(HP* hp);
void HeapDestroy(HP* hp);
void HeapPrint(HP* hp);
void Swap(hpDataType* a, int i, int j);
void Adjustup(hpDataType* a, int child);
void HeapPush(HP* hp, hpDataType x);
//void HeapPop(HP* hp);
void HeapPop(HP* hp);
hpDataType HeapTop(HP* hp);
void PrintTopK(int* a, int n, int k);
void HeapSort(int* a, int n);
